# myColourModule.py # # Description: Contains functions related to pixels and their colour. # # Author: AL # Date: 2024 def isPixelGreen(r, g, b): ''' Function that returns True when pixel is green, otherwise, False.''' # return g == 255 # return 200 <= g <= 255 return r > 180 and r >= 0 and g > 200 and g <= 255 and b < 120 and b >= 0 # Define a function to detect yellow pixels # def isPixelYellow(R, G, B): # ''' Returns True if the given pixel is yellow, otherwise False.''' # return R > 150 and G > 150 and B < 100 def isPixelYellow(colourTuple): ''' Returns True if the given pixel is yellow, otherwise False.''' return colourTuple[0] > 150 and colourTuple[1] > 150 and colourTuple[2] < 100